/**
 *    Copyright 2006-2016 the original author or authors.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */
package org.mybatis.generator.codegen.mybatis3.javamapper.elements;

import java.util.Set;
import java.util.TreeSet;

import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType;
import org.mybatis.generator.api.dom.java.Interface;
import org.mybatis.generator.api.dom.java.JavaVisibility;
import org.mybatis.generator.api.dom.java.Method;
import org.mybatis.generator.api.dom.java.Parameter;

/**
 * 
 * @author Jeff Butler
 * 
 */
public class UpdateByPrimaryKeyWithoutBLOBsMethodGenerator extends
        AbstractJavaMapperMethodGenerator {

    public UpdateByPrimaryKeyWithoutBLOBsMethodGenerator() {
        super();
    }

    @Override
    public void addInterfaceElements(Interface interfaze) {
        Set<FullyQualifiedJavaType> importedTypes = new TreeSet<FullyQualifiedJavaType>();
        FullyQualifiedJavaType parameterType = new FullyQualifiedJavaType(
                introspectedTable.getBaseRecordType());
        importedTypes.add(parameterType);

//        //新增一个方法
//        Method method = new Method();
//        
//        //添加方法修饰符PUBLIC
//        method.setVisibility(JavaVisibility.PUBLIC);
//        
//        //设置返回值，这里我用的是自定义的void，无返回值方法 getVoidInstance()
//		//FullyQualifiedJavaType类中可以自定义返回值方法，大家可以自己进去添加
//		//不想那么麻烦的话，可以 new FullyQualifiedJavaType("void") ， 构造函数写上返回类型就行了
//        method.setReturnType(FullyQualifiedJavaType.getVoidInstance());
//        
//        //设置方法名，同样可以自己进去看
//        method.setName(introspectedTable.getUpdateByPrimaryKeyStatementId());
//        
//        //method.addParameter(new Parameter(parameterType, "record")); //$NON-NLS-1$
//
//        FullyQualifiedJavaType mapType=FullyQualifiedJavaType.getMyMapInstance();
//        //方法的参数，这里是Map类型的dateMap参数
//        Parameter parameter = new Parameter(mapType, "dataMap");
//        method.addParameter(parameter);
//        
//        context.getCommentGenerator().addGeneralMethodComment(method,
//                introspectedTable);

//        addMapperAnnotations(interfaze, method);
//        
//        if (context.getPlugins()
//                .clientUpdateByPrimaryKeyWithoutBLOBsMethodGenerated(method,
//                        interfaze, introspectedTable)) {
//            interfaze.addImportedTypes(importedTypes);
//            interfaze.addMethod(method);
//        }
    }

    public void addMapperAnnotations(Interface interfaze, Method method) {
    }
}
